﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using CE.Global;
using CE.Database;

public partial class carinsurance_PendingApplication : System.Web.UI.Page
{
    protected override void InitializeCulture()
    {
        String selectedCulture = CE.Global.General.SetCulture();
        base.InitializeCulture();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[CE.Global.General.UserId] == null)
        {
            Response.Redirect("~/SiteUserSecureLogin.aspx");
        }

        if (Session[General.UserRole] != null && Session[General.UserRole].ToString() == "201")
        {
            hplAppStatus.Enabled = false;
            hplAppStatus.Visible = false;
            hplAgentIndCall.Visible = false;
        }

        if (Session[General.IsMerchantAgent] != null && Session[General.IsMerchantAgent] == "2")
        {
            hplMerchant.Visible = true;
        }

        if (Session[General.IsCTPL] != null && Session[General.IsCTPL] == "3")
        {
            hplCMI.Visible = true;
        }

        if (Session[General.UserRole].ToString() != "100")
        {
            //hplMerchant.Visible = true;
            //hplCMI.Visible = true;
            hplRenewalNotice.Visible = true;
            hplFollowUpPolicy.Visible = true;
            hplCoverNote.Visible = true;
        }

        if (!Page.IsPostBack)
        {
            CE.User.AccountStatusDB _accountStatusDB = new CE.User.AccountStatusDB();
            int _pwdStatus = _accountStatusDB.GetLastPasswordChagedStatus(Convert.ToInt64(Session[CE.Global.General.UserId].ToString()));
            if (_pwdStatus == 1)
            {
                Response.Redirect("~/User/ChangePassword.aspx");
            }
        }
    }
}
